package com.filetransfer.view.Panel;
import com.filetransfer.controller.FileTransferController;

import javax.swing.*;
import java.awt.*;
public class TabbedPanel extends JPanel {
    public static JPanel createTabbedPane() {
        FileTransferController controller = new FileTransferController();
        JTabbedPane tabbedPane = new JTabbedPane();
        // 添加上传面板
        UploadPanel uploadPanel = new UploadPanel(controller);
        tabbedPane.addTab("上传", uploadPanel);
        // 添加下载面板
        DownloadPanel downloadPanel = new DownloadPanel(controller);
        tabbedPane.addTab("下载", downloadPanel);
        // 将 TabbedPane 添加到主面板
        JPanel mainPanel = new JPanel(new BorderLayout());
        mainPanel.add(tabbedPane, BorderLayout.CENTER);
        return mainPanel;
    }
}
